#pragma once
#include "BWAPI.h"
#include <fstream>
#include <time.h>
#include <hash_map>

using namespace BWAPI;
using namespace std;
using namespace stdext;

class ExtractData
{
public:
	ExtractData(void);
	void ExtractData::Tick();
	bool ExtractData::SaveData(string fileName);
private:
	list<string> _csvRows;
	clock_t _startClock;
	hash_map<int, int> _previousHealth;
	hash_map<int, clock_t> _unitLastlogged;
	float ExtractData::GetDistanceBetweenPoisitions(Position pos1, Position pos2);
	Unit * ExtractData::FindNearestEnemy(Unit * unit, float searchDistance);
	bool ExtractData::HasUnitBeenAttacked(Unit * unit);

	bool ExtractData::IncludeInData(Unit * unit, Unit * closestEnemy);

	//Used to determine when units are "in battle"
	float _enemyBattleDistanceMultiplyer;
	float _nearestEnemySearchDistance;
};

